package cn.tedu.spring.config;

import cn.tedu.spring.di.UserService;
import cn.tedu.spring.life.DBConnect;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestScan {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        UserService userService = context.getBean(UserService.class);
        System.out.println("userService = " + userService);

        DBConnect dbConnect = context.getBean(DBConnect.class);
        System.out.println("dbConnect = " + dbConnect);
    }
}
